<?php
/**
 * +----------------------------------------------------------------------
 * | summer framework
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020 https://github.com/suframe/think-admin All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: summer <806115620@qq.com>  2020/3/30 14:30
 * +----------------------------------------------------------------------
 */
declare (strict_types = 1);

namespace app\mall\model\traits;

use app\mall\model\MallGoodsDetail;
use think\Model;
use think\model\relation\HasOne;

/**
 * 商品详细
 * trait GoodsDetailTrait
 * @package app\mall\model\traits
 * @mixin Model
 * @property integer $goods_id
 */
trait GoodsDetailTrait
{

    /**
     * 获取商品
     * @return HasOne
     */
    public function detail(): HasOne
    {
        return $this->hasOne(MallGoodsDetail::class, 'goods_id');
    }

}